package function;

public class Judge {
/*
 * 判断功能
 * 	boolean equals(Object anObject) 比较字符串内容是否相同（区分大小写）
 *	boolean	equalsIgnoreCase(String anotherString) 比较字符串内容是否相同（忽略大小写）
 *	boolean contains(String s) 判断大字符串是否包含小字符串
 *	boolean startsWith(String prefix) 判断字符串是否以某个字符串开头
 *	boolean endsWith(String prefix) 判断字符串是否以某个字符串结尾
 *  boolean isEmpty() 判断字符串是否为空
 * 
 * */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		String s1="helloworld";
		String s2="HelloWorld";
		String s3="hello";
		String s4="world";
		String s5="";
		//String s6=null;
		System.out.println(s1.equals(s2));
		System.out.println(s1.equalsIgnoreCase(s2));
		System.out.println(s1.contains(s3));
		System.out.println(s2.startsWith(s3));
		System.out.println(s2.endsWith(s4));
		System.out.println(s4.isEmpty());
		System.out.println(s5.isEmpty());
		//System.out.println(s6.isEmpty());//空指针异常
		
		
		
	}

}
